import { Label } from '../orm/Label';

export function getLabels(text:string, labels:string[]) : string[] {
  return labels;
}

export function labelsToString(labels: Label[]): string {
  let res = ""
  for (let label of labels) {
    res += label.value + "+"
  }
  return res.length ? res.slice(0,res.length-1) : res;
}

export function rawLabelsToString(labels: string[]): string {
  let res = ""
  for (let label of labels) {
    res += label + "+"
  }
  return res.length ? res.slice(0,res.length-1) : res;
}

export function stringToLabels(labelString: string): string[] {
  return labelString.length ? labelString.split('+') : []
}